﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title> </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content=" ">
    <meta name="generator" content="docfx 2.56.6.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">

<p>Android and UWP apps both require that you specify which devices you will need to access in their manifest files. This is because Store apps are secure and won't let a given app access devices without the user's knowledge. On UWP, if you do not specify the setup correctly, you will be able to enumerate the device, but not connect to it.</p>
<p>Here is an example Capabilities section of the Package.appxmanifest for Hid and USB on UWP:</p>
<pre><code class="lang-xml">  &lt;Capabilities&gt;
    &lt;Capability Name=&quot;internetClient&quot; /&gt;

    &lt;uap:Capability Name=&quot;removableStorage&quot; /&gt;

    &lt;DeviceCapability Name=&quot;humaninterfacedevice&quot;&gt;

      &lt;Device Id=&quot;vidpid:534C 0001&quot;&gt;
        &lt;Function Type=&quot;usage:0005 *&quot; /&gt;
        &lt;Function Type=&quot;usage:FF00 0001&quot; /&gt;
        &lt;Function Type=&quot;usage:ff00 *&quot; /&gt;
      &lt;/Device&gt;

      &lt;Device Id=&quot;vidpid:1209 53C0&quot;&gt;
        &lt;Function Type=&quot;usage:0005 *&quot; /&gt;
        &lt;Function Type=&quot;usage:FF00 0001&quot; /&gt;
        &lt;Function Type=&quot;usage:ff00 *&quot; /&gt;
      &lt;/Device&gt;

      &lt;Device Id=&quot;vidpid:1209 53C1&quot;&gt;
        &lt;Function Type=&quot;usage:0005 *&quot; /&gt;
        &lt;Function Type=&quot;usage:FF00 0001&quot; /&gt;
        &lt;Function Type=&quot;usage:ff00 *&quot; /&gt;
      &lt;/Device&gt;

    &lt;/DeviceCapability&gt;

    &lt;DeviceCapability Name=&quot;usb&quot;&gt;

      &lt;!--Trezor Firmware 1.7.x --&gt;
      &lt;Device Id=&quot;vidpid:1209 53C1&quot;&gt;
        &lt;Function Type=&quot;classId:ff * *&quot; /&gt;
      &lt;/Device&gt;

    &lt;/DeviceCapability&gt;

  &lt;/Capabilities&gt;
</code></pre>
<p><a href="https://github.com/MelbourneDeveloper/Device.Net/blob/b703a5eb5576c06ddb6ab9b9412615b75c792c66/src/Usb.Net.UWP.Sample/Package.appxmanifest#L46">Code Reference</a></p>
<p>Here is an Android example of the device_filter.xml file on Android (This is a resource file found at Resources/xml). Note these are the same devices as above written in decimal instead of hex.</p>
<pre><code class="lang-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;resources&gt;
  &lt;usb-device vendor-id=&quot;21324&quot; product-id=&quot;1&quot; /&gt;
  &lt;usb-device vendor-id=&quot;4617&quot; product-id=&quot;21440&quot; /&gt;
  &lt;usb-device vendor-id=&quot;4617&quot; product-id=&quot;21441&quot; /&gt;
&lt;/resources&gt;
</code></pre>
<p><a href="https://github.com/MelbourneDeveloper/Trezor.Net/blob/a964eeddbd68dc57c4b81fbe28ae6444b0137a0b/src/Trezor.Net.XamarinFormsSample/XFAS/Resources/xml/device_filter.xml#L1">Code Reference</a></p>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/MelbourneDeveloper/Device.Net/blob/develop/docfx_project/articles/DevicePermissionSetup.md/#L1" class="contribution-link">Improve this Doc</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>In This Article</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
